package cn.pupil.springframework.beans.factory.config;

import cn.pupil.springframework.beans.BeansException;
import cn.pupil.springframework.beans.factory.BeanFactory;

/**
 * @Description: 自动化处理Bean工厂配置的接口
 * @Author: pupil
 * @Date: 2024/11/4 下午 8:38
 */
public interface AutowireCapableBeanFactory extends BeanFactory {

    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessBeforeInitialization 方法
     *
     * @param existingBean 现有的Bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) throws BeansException;


    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessorsAfterInitialization 方法
     *
     * @param existingBean 现有的Bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeansException;

}
